home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-19 / pkey12_1.zip / LD.LSP < prev    next >
Text File  |  1992-09-13  |  2KB  |  50 lines

  1. ;Add a leader note to your drawing (handy)
  2. ;
  3. ;
  4. (defun lderr (s)
  5. (if (/= s "Function cancelled")(princ (strcat "\nError: " s)))
  6. (setq rw *rw)
  7. (setq tg *tg)
  8. (setq kb *kb)
  9. (setvar "orthomode" OM)
  10. (setq *error* olderr)
  11. (princ))
  12. (defun dtr (angg)
  13. (* pi (/ angg 180.0)))
  14. (setq olderr *error* *error* lderr)
  15. (if (= *rw nil)(setq *rw "A")(setq rw *rw))
  16. (setq om (getvar "orthomode"))
  17. (if (= *scf nil)(setq *scf 96.0)
  18. (setq scf *scf))
  19. (setq OM(getvar"orthomode"))
  20. (princ "\nEnter the Scale Factor for this sheet < ")
  21. (princ *scf)
  22. (setq scf (getreal " >: "))
  23. (if (= scf nil)(setq scf *scf)(setq *scf scf))
  24. (setq arw(getstring (strcat "\n(A)rch. arrow. (D)im arrow.  Do(T). < ")
  25. (prompt *rw)(prompt "\ >")(princ)))
  26. (if(= arw "")(setq arw *rw)(setq *rw arw))
  27. (IF(OR(= arw "A")(= arw "a"))(SETQ arw "aarw"))
  28. (IF(OR(= arw "D")(= arw "d"))(SETQ arw "darw"))
  29. (IF(OR(= arw "T")(= arw "t"))(SETQ arw "dota"))
  30. (setq FP(getpoint "\nPick leader startpoint : "))
  31. (setvar "orthomode" 0)
  32. (setq SP(getpoint  FP "\nsecond point: "))
  33. (command "line" fp sp "")
  34. (setvar "orthomode" 1)
  35. (setq EP(getpoint  sp "\nend point: "))
  36. (IF(= EP NIL)(SETQ EP SP))
  37. (setq tt(* scf 0.05))
  38. (setq a1(angle fp sp))
  39. (setq a2(* a1 57.2958))
  40. (setq ang(angle sp ep))
  41. (setq tpa(polar ep(+ ang (dtr 0)) tt))
  42. (setq tp1(polar tpa(- ang (dtr 90)) tt))
  43. (setq th(* scf 0.09375))
  44. (command"insert" arw fp scf "" a2)
  45. (command"line" sp ep "")
  46. (command"dtext" tp1 "0")
  47. (setq *error* olderr)
  48. (setvar "orthomode" om)
  49. (setq fp nil sp nil ep nil tt nil a1 nil a2 nil ang nil tpa nil tp1 nil th nil arw1 nil lderr nil)
  50. (princ)